<?php
namespace Admin\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
        //redirect(U('Users/listUsers'));
        header('Access-Control-Allow-Origin:*');
        $this->display();
    }

    public function put(){
        header('Access-Control-Allow-Origin:*');

        $input = I('english');
        $data['data'] = $input;
        $result = M('English')->data($data)->add();
        if($result)
        {
            $this->assign('data','true');
        }
        else
            $this->assign('data','false');
        $this->display();
    }

    public function get()
    {
        header('Access-Control-Allow-Origin:*');
        $result = M('English')->order('id desc')->limit(1)->find();
        $this->ajaxReturn($result);
    }
}